package com.auxgroup.smarthome.mqtt;

import lombok.Data;
import org.fusesource.mqtt.client.QoS;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @author Qiuhua Lai
 * @email qhlai@gizwits
 */
@Data
@ConfigurationProperties(prefix = "mqtt.client")
public class MqttConfProp {
    /**
     * MQTT服务器地址
     */
    private String host = "127.0.0.1";
    /**
     * MQTT服务器端口
     */
    private int port = 1883;
    /**
     * 心跳时间 默认30秒
     */
    private short keepAlive = 30;
    /**
     * 遗愿Qos类型, ctrl-c 后发送的消息类型
     */
    private QoS willQoS = QoS.AT_LEAST_ONCE;
    /**
     * 遗愿话题, ctrl-c 后发送的话题
     */
    private String willTopic;
    /**
     * 遗愿消息, ctrl-c 后发送的消息
     */
    private String willMessage;
    /**
     * 设置重新连接的次数  默认-1
     */
    private long reconnectAttemptsMax = -1L;
    /**
     * 设置重连的间隔时间 默认10L
     */
    private long reconnectDalay = 10L;
    /**
     * 设置缓冲的大小 默认65536
     */
    private int sendBufferSize = 65536;
    /**
     * 连接前清空会话信息
     */
    private boolean cleanSession = true;
    /**
     * Mqtt version信息
     */
    private String version = "3.1.1";
}
